var ping = require('ping')
const fs = require('fs')

const guiconfig = './ip-list.json'
const content = fs.readFileSync(guiconfig, 'utf8')
const contentObj = JSON.parse(content)

contentObj.forEach(host => {
  ping.sys.probe(host, function (isAlive) {
    // console.log(` == 链接:${host} == `)
    if (isAlive) console.log(host + ' - 成功')
    else console.error(host + ' - 失败')
  })
})
